package 第二章实用类作业;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class CaiPiao {

        public static void main(String[] args) {
            ArrayList<Integer> list=new ArrayList<>();
            Random ran=new Random();
            int num1=ran.nextInt(32)+1;
            list.add(num1);
            do {
                int num = ran.nextInt(32)+1;
                for (int i = 0; i < list.size(); i++) {
                    int s = (int) list.get(i);
                    if (s!=num){
                        list.add(num);
                    }break;
                }
            }while (list.size()!=6);
            Collections.sort(list);
            int numBlue = ran.nextInt(32)+1;
            list.add(numBlue);
            for(int a:list){
                System.out.print(a+",");
            }
        }
    }

